<?php
$handle = curl_init('http://147.251.54.136:8182/places/');

// fake browser headers, otherwise server doesn't response nicely
$headers = array(
    'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
    'Accept-Language: cs,en;q=0.8,en-gb;q=0.5,en-us;q=0.3',
    'Accept-Encoding: gzip, deflate',
    'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7',
    'Keep-Alive: 115',
    'Connection: keep-alive',
);
$options = array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING       => '',
    CURLOPT_USERAGENT      => "proxy",
    CURLOPT_AUTOREFERER    => true,
    CURLOPT_CONNECTTIMEOUT => 20,
    CURLOPT_TIMEOUT        => 20,
    CURLOPT_MAXREDIRS      => 10,
    CURLOPT_HTTPHEADER     => $headers,
);
curl_setopt_array($handle, $options);
$response = curl_exec($handle);
curl_close($handle);

if (!empty($response)) {
    header('Content-Type: application/xml; charset=UTF-8');
    echo $response;
} else {
    $ip = file_get_contents('http://automation.whatismyip.com/n09230945.asp');
    header("HTTP/1.1 500 Server unreachable from this machine ($ip)");
}

